<?php /* Smarty version Smarty-3.1.18, created on 2017-07-22 21:36:05
         compiled from "/Applications/MAMP/htdocs/PHP/jifenshop/protected/template/wap/integral.history.html" */ ?>
<?php /*%%SmartyHeaderCode:2026701125597354c5234329-23414422%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '20e51ecd747ee5232cdce451677dde090f4cdd7a' => 
    array (
      0 => '/Applications/MAMP/htdocs/PHP/jifenshop/protected/template/wap/integral.history.html',
      1 => 1477061753,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2026701125597354c5234329-23414422',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'data' => 0,
    'g' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_597354c52cc281_16924921',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_597354c52cc281_16924921')) {function content_597354c52cc281_16924921($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<body class="gr">

<div class="navBar">
	<a class="left" href="javascript:history.back()"><i class="return"></i></a>
	<div class="titleView">积分明细</div>
</div>

<div class="commission-history main-padding-top">
	<div class="pullRefresh">
		<ul class="list">
			<?php  $_smarty_tpl->tpl_vars['g'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['g']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['data']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['g']->key => $_smarty_tpl->tpl_vars['g']->value) {
$_smarty_tpl->tpl_vars['g']->_loop = true;
?>
			<li class="ge-bottom ge-light">
				<div <?php if (strpos($_smarty_tpl->tpl_vars['g']->value->integral,'-')!==false) {?>class="r"<?php }?>><?php echo $_smarty_tpl->tpl_vars['g']->value->integral;?>
</div>
				<span><?php echo $_smarty_tpl->tpl_vars['g']->value->memo;?>
</span>
				<font class="scale10-left"><?php echo $_smarty_tpl->tpl_vars['g']->value->add_time;?>
</font>
			</li>
			<?php } ?>
		</ul>
	</div>
</div>

<?php echo $_smarty_tpl->getSubTemplate ("footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<script>
var offset = $('.pullRefresh .list > li').length;
function createHtml(g){
	var html = '<li class="ge-bottom ge-light">\
		<div '+(g.integral.indexOf('-')>-1?'class="r"':'')+'>'+g.integral+'</div>\
		<span>'+g.memo+'</span>\
		<font class="scale10-left">'+g.add_time+'</font>\
	</li>';
	offset++;
	return html;
}
$(function(){
	$('.commission-history').height($.window().height-$('.commission-history').padding().top);
	$('.pullRefresh').pullRefresh({
		header : true,
		footer : true,
		footerNoMoreText : '- END -',
		refresh : function(fn){
			var _this = this;
			offset = 0;
			$.getJSON('api.php?app=integral&act=history', function(json){
				if(json.error!=0){ $.overloadError(json.msg);return }
				var html = '';
				if($.isArray(json.data))for(var i=0; i<json.data.length; i++)html += createHtml(json.data[i]);
				_this.find('.list').html(html);
				fn();
			});
		},
		load : function(fn){
			var _this = this;
			$.getJSON('api.php?app=integral&act=history', { offset:offset }, function(json){
				if(json.error!=0){ $.overloadError(json.msg);return }
				var html = '';
				if($.isArray(json.data))for(var i=0; i<json.data.length; i++)html += createHtml(json.data[i]);
				_this.find('.list').append(html);
				fn();
			});
		}
	});
});
</script><?php }} ?>
